@import "../styles.scss";

.modal-background {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  overflow: auto;
  background: rgba(0,0,0,0.3);
}

.modal-foreground {
  position: relative;
  top: 10%;
  left: auto;
  right: auto;
  bottom: auto;
  background: #fff;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 2px;
  outline: none;
  padding: 20px;
  z-index: 1001;
  box-sizing: border-box;
  width: 500px;
  max-width: 95%;
  margin: 0 auto;
  box-shadow: 0 0 1em gray;
}

.modal {
  line-height: 1.4em;

  h1 {
    font-size: 140%;
    margin: 0 0 4 * $margin;
  }

  a {
    color: $red;
  }

  .modal-text {
    margin: 10px 0;
  }

  input.regular,
  textarea.regular {
    padding: 5px;
    border-radius: 2px;
    border: 1px solid $light-gray;
    width: 100%;
    box-sizing: border-box;
    font-size: 14px;
  }

  .modal-share {
    .code {
      font-family: monospace;
    }
  }

  input.error {
    color: $red;
    border-color: $red;
  }

  .error-message {
    color: $red;
    margin: $margin 0;
  }

  .modal-action-menu {
    padding: 4 * $margin 0 0;
    text-align: right;
  }

  .modal-button {
    @include generic-button;

    margin-left: 10px;
    padding: 10px 20px;
    border: none;
    border-radius: 2px;
    font-size: 14px;
    cursor: pointer;

    background: $light-gray;

    &.left {
      margin-left: 0;
    }

    &:hover,
    &:active {
      background: darken(white, 10%);
    }

    &.primary {
      background-color: $theme-color-secondary;
      color: $white;

      &:hover,
      &:active {
        background-color: lighten($theme-color-secondary, 10%);
      }
    }

    &.full-width {
      width: 100%;
    }

    &.danger {
      background-color: $red;
      color: white;
    }

    &.danger:hover,
    &.danger:active {
      background-color: lighten($red, 10%);
    }

    &.success {
      background-color: $green;
    }

    &.success:hover,
    &.success:active {
      background-color: lighten($green, 10%);
    }
  }
}
